swplugindllex.h File Reference
Detailed Description
The file defines the C functions that must be implemented by each plugin extender. They form the interface that allows Server Watch to communicate with your plugin. They are very similar to that found in the plugin definitions, with some changes.
- See also:
- SWPluginServerStruct
Go to the source code of this file.
Enumeration Type Documentation
|
The elements of this enum represent the possible things that a plugins could be queried about support for - Enumeration values:
-
PING |
Whether or not ping should be called on the plugin extender. |
MENUS |
Whether or not the plugin extender adds menu items. |
|
Function Documentation
|
Called by Server Watch when the plugin is initially loaded.
This will be the first function called on the plugin and is a good place to initialize any global plugin data. It is perfectly valid to do nothing but return SW_OK if you do not need to do anything in this function. - Return values:
-
| SW_OK | Return this if the processing within this function was successful |
| SW_FAIL | Return this if the processing within this function failed |
|
|
Called by Server Watch when the plugin is unloaded (shut down).
This is an appropriate place to cleanup any global plugin data that may have been created during the regular processing of the plugin. It is perfectly valid to do nothing but returns W_OK if you do not need to do anything in this function. - Return values:
-
| SW_OK | Return this if the processing within this function was successful |
| SW_FAIL | Return this if the processing within this function failed |
|
|
Called by Server Watch in order to ascertain what functionality it supports.
- Note:
- Remember that future versions of the Server Watch API will likely support new functionality, so if you return false for all the types the plugin does not support, including those that have not been defined yet, then your code will be substantially more resilient to those changes.
- Parameters:
-
| eType | The functionality that Server Watch is querying about. |
- Return values:
-
| true | The specified functionality is supported by the plugin |
| false | The specified functionality is not supported by the plugin |
|
bool DoYouExtend |
( |
const SWHandle * |
pluginHandle |
) |
|
|
|
Called by Server Watch in order to ascertain what plugins should be extended. Server Watch will call this function for each standard plugin that has been loaded with the SWHandle identifier of that plugin. - Note:
- You can get a plugins handle in "Settings" section of Server Watch on the "About Plugins" pane. The text of the handle can be copied from that pane to simplify this process.
- Parameters:
-
| pluginHandle | The handle of the plugin in question. |
- Return values:
-
| true | The specified plugin is extended by this pluginex |
| false | ReturnThe specified plugin is not extended by this pluginex |
|
|
Called whenever a new server is created by the user or by Server Watch at load time (called for each saved server). This is where any of your per-server initialization should be located.
If you need to store your own data related to this server that cannot be stored in either the ISWServerData or ISWServerSettings classes, you can create your own structure or class, and set SWPluginServerStruct's pCustomData variable to point to that structure or class. This object will then be passed to all of the plugin functions that require knowledge of specific server data. You won't need to store it yourself, but you will need to cleanup that structure or class on subsequent calls to CleanupServer(). - Parameters:
-
- Return values:
-
| SW_OK | Return this if the processing within this function was successful |
| SW_FAIL | Return this if the processing within this function failed |
- See also:
- SWPluginServerStruct, ISWServerData, ISWServerSettings, CleanupServer
|
|
Called whenever a server is deleted by the user or by Server Watch at shutdown (called for each server). This is where you handle the cleanup of any data or resources you created that were associated to this server.
- Note:
- If you created a structure or class and attached it to the pCustomData variable inside of the SWPluginServerStruct, you need to cleanup that memory here.
- Parameters:
-
- Return values:
-
| SW_OK | Return this if the processing within this function was successful |
| SW_FAIL | Return this if the processing within this function failed |
- See also:
- SWPluginServerStruct, ISWServerData, ISWServerSettings, InitServer
|
|
Called whenever the user presses the "Update" button or when the data is update automatically in monitor mode. This is where you should update the associated ISWServerData class with the servers current status information.
This function is always called in its own thread. This is a critical aspect of the Server Watch plugin API. If we did not do this, the Server Watch GUI would pause everytime that a ping took longer to perform than several milliseconds (which is common during ping). In this special case you will not need to call Retain() or Release() on either ISWServerData or ISWServerSettings because the API has already performed those calls for you (calling them a second time, however, shouldn't hurt anything). - Parameters:
-
- Return values:
-
| SW_OK | Return this if the processing within this function was successful |
| SW_FAIL | Return this if the processing within this function failed |
- See also:
- ISWServerData, ISWServerSettings
|
|
Called whenever Server Watch needs to display a context menu.
When an operation that can trigger plugin custom action is triggered, this function is called to allow the plugin to provide Server Watch with a menu definition for the menu corresponding to the current action context.
- Parameters:
-
| pThisServer | An SWPluginServerStruct that contains the information related to this server. |
| pPluginMenu | An ISWPluginMenu used to retrieve context information for the menu, as well, as the interface to create menu items in the menu. |
- Return values:
-
| SW_OK | Return this if the processing within this function was successful |
| SW_FAIL | Return this if the processing within this function failed |
|